package cn.appsys.controller;

import cn.appsys.service.CategoryService;
import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/category")
public class CategoryController {

    @Resource
    CategoryService categoryService;

    @GetMapping("/categoryLevelList")
    @ResponseBody
    public Object categoryLevelList(@RequestParam(value = "pid",defaultValue = "1") Integer pid){
        return JSON.toJSONString(categoryService.getCategoryLevelList(pid));
    }

}
